package wiki.zimo.certificate_manage.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;
/**
 *
 * @author 子墨
 * @date 2018/10/9 16:58
 * @describe 专业信息实体类
 */
@Entity
public class Major {
    @Excel(name = "id" ,orderNum = "0")
    private String id;
    @Excel(name = "专业名称" ,orderNum = "1")
    private String majorName;
    @Excel(name = "班级名称" ,orderNum = "2")
    private String majorClass;
    @Excel(name = "所属二级学院" ,orderNum = "3")
    private String majorSchool;

    public Major() {
    }

    @Id
    @Column(name = "Id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "major_name")
    public String getMajorName() {
        return majorName;
    }

    public void setMajorName(String majorName) {
        this.majorName = majorName;
    }

    @Basic
    @Column(name = "major_school")
    public String getMajorSchool() {
        return majorSchool;
    }

    public void setMajorSchool(String majorSchool) {
        this.majorSchool = majorSchool;
    }

    @Basic
    @Column(name = "major_class")
    public String getMajorClass() {
        return majorClass;
    }

    public void setMajorClass(String majorClass) {
        this.majorClass = majorClass;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Major major = (Major) o;
        return Objects.equals(id, major.id) &&
                Objects.equals(majorName, major.majorName) &&
                Objects.equals(majorClass, major.majorClass) &&
                Objects.equals(majorSchool, major.majorSchool);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, majorName, majorClass, majorSchool);
    }

    @Override
    public String toString() {
        return "Major{" +
                "id='" + id + '\'' +
                ", majorName='" + majorName + '\'' +
                ", majorClass='" + majorClass + '\'' +
                ", majorSchool='" + majorSchool + '\'' +
                '}';
    }
}
